// roslibjs
function _rosInit() {
  var rosObj = new ROSLIB.Ros();
  return rosObj;
}

function _rosConnect(url) {
  rosRobot.state.rosObj.connect(url);
}

function _rosClose() {
  rosRobot.state.rosObj.close();
}

function _rosOnConnection() {
  rosRobot.state.rosObj.on("connection", function () {
    console.log("ros connection");
  });
}

function _rosOnClose() {
  rosRobot.state.rosObj.on("close", function () {
    console.log("ros close");
  });
}

function _rosOnError() {
  rosRobot.state.rosObj.on("error", function () {
    console.log("ros error");
  });
}

// 红外模块
function _rosListener_robotInfrared() {
  var robotInfrared = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/thermal/image_proc/compressed",
    messageType: "sensor_msgs/CompressedImage"
  });
  return robotInfrared;
}

// 定位坐标
function _rosListener_robotPose() {
  var robotPose = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/robot_pose",
    messageType: "yidamsg/Yida_pose"
  });
  return robotPose;
}

// 结果上传模块
function _rosListener_robotDetectResult() {
  var robotDetectResult = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/detect_result",
    messageType: "yidamsg/InspectedResult"
  });
  return robotDetectResult;
}

// 云台控制模块
function _rosListener_robotHolderControl() {
  var robotHolderControl = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/yunTai_ctrl",
    messageType: "yidamsg/yuntai_control"
  });
  return robotHolderControl;
}

// 上位机控制车体
function _rosListener_robotCarControl() {
  var robotCarControl = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/yida/robot/motor_control2",
    messageType: "yidamsg/motor_control"
  });
  return robotCarControl;
}

// 控制模式切换
function _rosListener_robotControlModel() {
  var robotControlModel = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/yida/robot/control_mode",
    messageType: "std_msgs/Int16"
  });
  return robotControlModel;
}

// 一键返航
function _rosListener_robotOnebuttonback() {
  var robotOnebuttonback = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/yida/robot/oneButtonBack",
    messageType: "yidamsg/onebutton"
  });
  return robotOnebuttonback;
}

// 门控制
function _rosListener_robotControlDoor() {
  var robotControlDoor = new ROSLIB.Service({
    ros: rosRobot.state.rosObj,
    name: "/control_door",
    serviceType: "Yidamsg/ControlDoor"
  });
  return robotControlDoor;
}

// 任务管理
function _rosListener_robotTaskClear() {
  var robotTaskClear = new ROSLIB.Service({
    ros: rosRobot.state.rosObj,
    name: "/taskclear",
    serviceType: "yidamsg/TaskControl"
  });
  return robotTaskClear;
}

// 路径规划
function _rosListener_robotTask() {
  var robotTask = new ROSLIB.Service({
    ros: rosRobot.state.rosObj,
    name: "/task",
    serviceType: "yidamsg/RoadPlan"
  });
  return robotTask;
}

// 任务执行过程中的状态
function _rosListener_robotTaskStatus() {
  var robotTaskStatus = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/task_status",
    messageType: "yidamsg/task_status"
  });
  return robotTaskStatus;
}

// 一键返航任务开始结束消息
function _rosListener_robotOneButtonTaskStatus() {
  var robotOneButtonTaskStatus = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/onebuttontask_status",
    messageType: "yidamsg/taskPlanStatus"
  });
  return robotOneButtonTaskStatus;
}

// 电量上报
function _rosListener_robotYXYCdata() {
  var robotYXYCdata = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/robot_yxycdata",
    messageType: "Yidamsg/nrcar_status"
  });
  return robotYXYCdata;
}

// 充电状态
function _rosListener_robotWeatherInfo() {
  var robotWeatherInfo = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/weather_info",
    messageType: "Yidamsg/weather"
  });
  return robotWeatherInfo;
}

// // // // // // 
// 巡检点位状态
function _rosListener_robotPointStatus() {
  var robotPointStatus = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/point_status",
    messageType: "yidamsg/point_status"
  });
  return robotPointStatus;
}

// 执行任务
function _rosListener_robotUrgencyTask() {
  var robotUrgencyTask = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/urgency_task",
    messageType: "yidamsg/UrgencyTask"
  });
  return robotUrgencyTask;
}

// 任务执行状态
function _rosListener_robotTaskExecuteStatus() {
  var robotTaskExecuteStatus = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/task_execute_status",
    messageType: "yidamsg/TaskExecuteStatus"
  });
  return robotTaskExecuteStatus;
}

// 任务控制状态
function _rosListener_robotTaskControlStatus() {
  var robotTaskControlStatus = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/task_control_status",
    messageType: "yidamsg/TaskControlStatus"
  });
  return robotTaskControlStatus;
}

// 巡检点结果(传给前端)
function _rosListener_robotInspectedResultWeb() {
  var robotInspectedResultWeb = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/detect_result_web",
    messageType: "yidamsg/InspectedResultWeb"
  });
  return robotInspectedResultWeb;
}

// 机器人报警结果(传给前端)
function _rosListener_robotSysAlarmWeb() {
  var robotSysAlarmWeb = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/sys_alarm_web",
    messageType: "yidamsg/AlarmMessage"
  });
  return robotSysAlarmWeb;
}

// 任务状态结果(传给前端)
function _rosListener_robotTaskRealStatusWeb() {
  var robotTaskRealStatusWeb = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/yida/robot/taskrealstatus",
    messageType: "yidamsg/TaskRealStatusWeb"
  });
  return robotTaskRealStatusWeb;
}

// 数据库更新表名
function _rosListener_robotDBTableUpdate() {
  var robotDBTableUpdate = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/db_table_update",
    messageType: "yidamsg/DBTableUpdate"
  });
  return robotDBTableUpdate;
}

// 路径规划状态返回
function _rosListener_robotTaskPlanStatus() {
  var robotTaskPlanStatus = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/yida/robot/task_plan_status",
    messageType: "yidamsg/taskPlanStatus"
  });
  return robotTaskPlanStatus;
}

// 控制模式状态
function _rosListener_robotControlMode() {
  var robotControlMode = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/control_mode",
    messageType: "yidamsg/ControlMode"
  });
  return robotControlMode;
}

// 狗窝 back 坐标
function _rosListener_robotDogHouseAndBackPoint() {
  var robotDogHouseAndBackPoint = new ROSLIB.Topic({
    ros: rosRobot.state.rosObj,
    name: "/set_start_back_point",
    messageType: "yidamsg/start_back_point"
  });
  return robotDogHouseAndBackPoint;
}

// Un ----------------------------------------
function _rosUnListener_robotInfrared() {
  if (rosRobot.state.robotInfrared) {
    rosRobot.state.robotInfrared.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotPose() {
  if (rosRobot.state.robotPose) {
    rosRobot.state.robotPose.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotDetectResult() {
  if (rosRobot.state.robotDetectResult) {
    rosRobot.state.robotDetectResult.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotHolderControl() {
  if (rosRobot.state.robotHolderControl) {
    rosRobot.state.robotHolderControl.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotCarControl() {
  if (rosRobot.state.robotCarControl) {
    rosRobot.state.robotCarControl.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotControlModel() {
  if (rosRobot.state.robotControlModel) {
    rosRobot.state.robotControlModel.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotOnebuttonback() {
  if (rosRobot.state.robotOnebuttonback) {
    rosRobot.state.robotOnebuttonback.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotControlDoor() {
  if (rosRobot.state.robotControlDoor) {
    // rosRobot.state.robotControlDoor.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotTaskClear() {
  if (rosRobot.state.robotTaskClear) {
    // rosRobot.state.robotTaskClear.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotTask() {
  if (rosRobot.state.robotTask) {
    // rosRobot.state.robotTask.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotTaskStatus() {
  if (rosRobot.state.robotTaskStatus) {
    rosRobot.state.robotTaskStatus.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotOneButtonTaskStatus() {
  if (rosRobot.state.robotOneButtonTaskStatus) {
    rosRobot.state.robotOneButtonTaskStatus.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotYXYCdata() {
  if (rosRobot.state.robotYXYCdata) {
    rosRobot.state.robotYXYCdata.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotWeatherInfo() {
  if (rosRobot.state.robotWeatherInfo) {
    rosRobot.state.robotWeatherInfo.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotPointStatus() {
  if (rosRobot.state.robotPointStatus) {
    rosRobot.state.robotPointStatus.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotDBTableUpdate() {
  if (rosRobot.state.robotDBTableUpdate) {
    rosRobot.state.robotDBTableUpdate.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotUrgencyTask() {
  if (rosRobot.state.robotUrgencyTask) {
    rosRobot.state.robotUrgencyTask.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotTaskExecuteStatus() {
  if (rosRobot.state.robotTaskExecuteStatus) {
    rosRobot.state.robotTaskExecuteStatus.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotTaskControlStatus() {
  if (rosRobot.state.robotTaskControlStatus) {
    rosRobot.state.robotTaskControlStatus.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotInspectedResultWeb() {
  if (rosRobot.state.robotInspectedResultWeb) {
    rosRobot.state.robotInspectedResultWeb.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotSysAlarmWeb() {
  if (rosRobot.state.robotSysAlarmWeb) {
    rosRobot.state.robotSysAlarmWeb.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotTaskRealStatusWeb() {
  if (rosRobot.state.robotTaskRealStatusWeb) {
    rosRobot.state.robotTaskRealStatusWeb.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotTaskPlanStatus() {
  if (rosRobot.state.robotTaskPlanStatus) {
    rosRobot.state.robotTaskPlanStatus.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotControlMode() {
  if (rosRobot.state.robotControlMode) {
    rosRobot.state.robotControlMode.unsubscribe();
  }
  return null;
}
function _rosUnListener_robotDogHouseAndBackPoint() {
  if (rosRobot.state.robotDogHouseAndBackPoint) {
    rosRobot.state.robotDogHouseAndBackPoint.unsubscribe();
  }
  return null;
}

const rosRobot = {
  state: {
    rosObj: null,
    robotInfrared: null,
    robotPose: null,
    robotControlModel: null,
    robotDetectResult: null,
    robotCarControl: null,
    robotHolderControl: null,
    robotOnebuttonback: null,
    robotControlDoor: null,
    robotTask: null,
    robotTaskStatus: null,
    robotOneButtonTaskStatus: null,
    robotYXYCdata: null,
    robotWeatherInfo: null,
    robotPointStatus: null,
    robotTaskClear: null,
    robotTaskExecuteStatus: null,
    robotUrgencyTask: null,
    robotTaskControlStatus: null,
    robotInspectedResultWeb: null,
    robotSysAlarmWeb: null,
    robotTaskRealStatusWeb: null,
    robotDBTableUpdate: null,
    robotTaskPlanStatus: null,
    robotControlMode: null,
    robotDogHouseAndBackPoint: null,
  },
  mutations: {
    SET_ROS_OBJ: (state, obj) => {
      state.rosObj = obj
    },
    SET_ROS_ROBOTPOSE: (state, obj) => {
      state.robotPose = obj
    },
    SET_ROS_ROBOTINFRARRED: (state, obj) => {
      state.robotInfrared = obj
    },
    SET_ROS_ROBOTDETECTRESULT: (state, obj) => {
      state.robotDetectResult = obj
    },
    SET_ROS_ROBOTHOLDERCONTROL: (state, obj) => {
      state.robotHolderControl = obj
    },
    SET_ROS_ROBOTCARCONTROL: (state, obj) => {
      state.robotCarControl = obj
    },
    SET_ROS_ROBOTCONTROLMODEL: (state, obj) => {
      state.robotControlModel = obj
    },
    SET_ROS_ROBOTONEBUTTONBACK: (state, obj) => {
      state.robotOnebuttonback = obj
    },
    SET_ROS_ROBOTCONTROLDOOR: (state, obj) => {
      state.robotControlDoor = obj
    },
    SET_ROS_ROBOTTASKCLEAR: (state, obj) => {
      state.robotTaskClear = obj
    },
    SET_ROS_ROBOTTASK: (state, obj) => {
      state.robotTask = obj
    },
    SET_ROS_ROBOTTASKSTATUS: (state, obj) => {
      state.robotTaskStatus = obj
    },
    SET_ROS_ROBOTONEBUTTONTASKSTATUS: (state, obj) => {
      state.robotOneButtonTaskStatus = obj
    },
    SET_ROS_ROBOTYXYCDATA: (state, obj) => {
      state.robotYXYCdata = obj
    },
    SET_ROS_ROBOTWEATHERINFO: (state, obj) => {
      state.robotWeatherInfo = obj
    },
    SET_ROS_ROBOTPOINTSTATUS: (state, obj) => {
      state.robotPointStatus = obj
    },
    SET_ROS_ROBOTDBTABLEUPDATE: (state, obj) => {
      state.robotDBTableUpdate = obj
    },
    SET_ROS_ROBOTURGENCYTASK: (state, obj) => {
      state.robotUrgencyTask = obj
    },
    SET_ROS_ROBOTTASKEXECUTESTATUS: (state, obj) => {
      state.robotTaskExecuteStatus = obj
    },
    SET_ROS_ROBOTTASKCONTROLSTATUS: (state, obj) => {
      state.robotTaskControlStatus = obj
    },
    SET_ROS_ROBOTINSPECTEDRESULTWEB: (state, obj) => {
      state.robotInspectedResultWeb = obj
    },
    SET_ROS_ROBOTSYSALARMWEB: (state, obj) => {
      state.robotSysAlarmWeb = obj
    },
    SET_ROS_ROBOTTASKREALSTATUSWEB: (state, obj) => {
      state.robotTaskRealStatusWeb = obj
    },
    SET_ROS_ROBOTTASKPLANSTATUS: (state, obj) => {
      state.robotTaskPlanStatus = obj
    },
    SET_ROS_ROBOTCONTROLMODE: (state, obj) => {
      state.robotControlMode = obj
    },
    SET_ROS_ROBOTDOGHOUSEANDBACKPOINT: (state, obj) => {
      state.robotDogHouseAndBackPoint = obj
    },
  },
  actions: {
    rosRun({ commit }, data) {
      return new Promise(resolve => {
        commit("SET_ROS_OBJ", _rosInit())
        _rosConnect(data.url);
        _rosOnConnection();
        _rosOnClose();
        _rosOnError();
        commit("SET_ROS_ROBOTINFRARRED", _rosListener_robotInfrared())
        commit("SET_ROS_ROBOTPOSE", _rosListener_robotPose())
        commit("SET_ROS_ROBOTDETECTRESULT", _rosListener_robotDetectResult())
        commit("SET_ROS_ROBOTHOLDERCONTROL", _rosListener_robotHolderControl())
        commit("SET_ROS_ROBOTCARCONTROL", _rosListener_robotCarControl())
        commit("SET_ROS_ROBOTCONTROLMODEL", _rosListener_robotControlModel())
        commit("SET_ROS_ROBOTONEBUTTONBACK", _rosListener_robotOnebuttonback())
        commit("SET_ROS_ROBOTCONTROLDOOR", _rosListener_robotControlDoor())
        commit("SET_ROS_ROBOTTASKCLEAR", _rosListener_robotTaskClear())
        commit("SET_ROS_ROBOTTASK", _rosListener_robotTask())
        commit("SET_ROS_ROBOTTASKSTATUS", _rosListener_robotTaskStatus())
        commit("SET_ROS_ROBOTONEBUTTONTASKSTATUS", _rosListener_robotOneButtonTaskStatus())
        commit("SET_ROS_ROBOTYXYCDATA", _rosListener_robotYXYCdata())
        commit("SET_ROS_ROBOTWEATHERINFO", _rosListener_robotWeatherInfo())
        commit("SET_ROS_ROBOTPOINTSTATUS", _rosListener_robotPointStatus())
        commit("SET_ROS_ROBOTDBTABLEUPDATE", _rosListener_robotDBTableUpdate())
        commit("SET_ROS_ROBOTURGENCYTASK", _rosListener_robotUrgencyTask())
        commit("SET_ROS_ROBOTTASKEXECUTESTATUS", _rosListener_robotTaskExecuteStatus())
        commit("SET_ROS_ROBOTTASKCONTROLSTATUS", _rosListener_robotTaskControlStatus())
        commit("SET_ROS_ROBOTINSPECTEDRESULTWEB", _rosListener_robotInspectedResultWeb())
        commit("SET_ROS_ROBOTSYSALARMWEB", _rosListener_robotSysAlarmWeb())
        commit("SET_ROS_ROBOTTASKREALSTATUSWEB", _rosListener_robotTaskRealStatusWeb())
        commit("SET_ROS_ROBOTTASKPLANSTATUS", _rosListener_robotTaskPlanStatus())
        commit("SET_ROS_ROBOTCONTROLMODE", _rosListener_robotControlMode())
        commit("SET_ROS_ROBOTDOGHOUSEANDBACKPOINT", _rosListener_robotDogHouseAndBackPoint())
        // 
        resolve(rosRobot.state)
      })
    },
    rosInit({ commit }, data) {
      return new Promise(resolve => {
        commit("SET_ROS_OBJ", _rosInit())
        resolve(rosRobot.state.rosObj)
      })
    },
    rosConnect({ commit }, data) {
      return new Promise(resolve => {
        _rosConnect(data.url);
        resolve()
      })
    },
    rosClose({ commit }, data) {
      return new Promise(resolve => {
        _rosClose();
        resolve()
      })
    },
    rosOnConnection({ commit }, data) {
      return new Promise(resolve => {
        _rosOnConnection();
        resolve()
      })
    },
    rosOnClose({ commit }, data) {
      return new Promise(resolve => {
        _rosOnClose();
        resolve()
      })
    },
    rosOnError({ commit }, data) {
      return new Promise(resolve => {
        _rosOnError();
        resolve()
      })
    },
    rosListener({ commit }, data) {
      return new Promise(resolve => {
        commit("SET_ROS_ROBOTINFRARRED", _rosListener_robotInfrared())
        commit("SET_ROS_ROBOTPOSE", _rosListener_robotPose())
        commit("SET_ROS_ROBOTDETECTRESULT", _rosListener_robotDetectResult())
        commit("SET_ROS_ROBOTHOLDERCONTROL", _rosListener_robotHolderControl())
        commit("SET_ROS_ROBOTCARCONTROL", _rosListener_robotCarControl())
        commit("SET_ROS_ROBOTCONTROLMODEL", _rosListener_robotControlModel())
        commit("SET_ROS_ROBOTONEBUTTONBACK", _rosListener_robotOnebuttonback())
        commit("SET_ROS_ROBOTCONTROLDOOR", _rosListener_robotControlDoor())
        commit("SET_ROS_ROBOTTASKCLEAR", _rosListener_robotTaskClear())
        commit("SET_ROS_ROBOTTASK", _rosListener_robotTask())
        commit("SET_ROS_ROBOTTASKSTATUS", _rosListener_robotTaskStatus())
        commit("SET_ROS_ROBOTONEBUTTONTASKSTATUS", _rosListener_robotOneButtonTaskStatus())
        commit("SET_ROS_ROBOTYXYCDATA", _rosListener_robotYXYCdata())
        commit("SET_ROS_ROBOTWEATHERINFO", _rosListener_robotWeatherInfo())
        commit("SET_ROS_ROBOTPOINTSTATUS", _rosListener_robotPointStatus())
        commit("SET_ROS_ROBOTDBTABLEUPDATE", _rosListener_robotDBTableUpdate())
        commit("SET_ROS_ROBOTURGENCYTASK", _rosListener_robotUrgencyTask())
        commit("SET_ROS_ROBOTTASKEXECUTESTATUS", _rosListener_robotTaskExecuteStatus())
        commit("SET_ROS_ROBOTTASKCONTROLSTATUS", _rosListener_robotTaskControlStatus())
        commit("SET_ROS_ROBOTINSPECTEDRESULTWEB", _rosListener_robotInspectedResultWeb())
        commit("SET_ROS_ROBOTSYSALARMWEB", _rosListener_robotSysAlarmWeb())
        commit("SET_ROS_ROBOTTASKREALSTATUSWEB", _rosListener_robotTaskRealStatusWeb())
        commit("SET_ROS_ROBOTTASKPLANSTATUS", _rosListener_robotTaskPlanStatus())
        commit("SET_ROS_ROBOTCONTROLMODE", _rosListener_robotControlMode())
        commit("SET_ROS_ROBOTDOGHOUSEANDBACKPOINT", _rosListener_robotDogHouseAndBackPoint())
        resolve(rosRobot.state)
      })
    },
    rosUnListener({ commit }, data) {
      return new Promise(resolve => {
        commit("SET_ROS_ROBOTINFRARRED", _rosUnListener_robotInfrared())
        commit("SET_ROS_ROBOTPOSE", _rosUnListener_robotPose())
        commit("SET_ROS_ROBOTDETECTRESULT", _rosUnListener_robotDetectResult())
        commit("SET_ROS_ROBOTHOLDERCONTROL", _rosUnListener_robotHolderControl())
        commit("SET_ROS_ROBOTCARCONTROL", _rosUnListener_robotCarControl())
        commit("SET_ROS_ROBOTCONTROLMODEL", _rosUnListener_robotControlModel())
        commit("SET_ROS_ROBOTONEBUTTONBACK", _rosUnListener_robotOnebuttonback())
        commit("SET_ROS_ROBOTCONTROLDOOR", _rosUnListener_robotControlDoor())
        commit("SET_ROS_ROBOTTASKCLEAR", _rosUnListener_robotTaskClear())
        commit("SET_ROS_ROBOTTASK", _rosUnListener_robotTask())
        commit("SET_ROS_ROBOTTASKSTATUS", _rosUnListener_robotTaskStatus())
        commit("SET_ROS_ROBOTONEBUTTONTASKSTATUS", _rosUnListener_robotOneButtonTaskStatus())
        commit("SET_ROS_ROBOTYXYCDATA", _rosUnListener_robotYXYCdata())
        commit("SET_ROS_ROBOTWEATHERINFO", _rosUnListener_robotWeatherInfo())
        commit("SET_ROS_ROBOTPOINTSTATUS", _rosUnListener_robotPointStatus())
        commit("SET_ROS_ROBOTDBTABLEUPDATE", _rosUnListener_robotDBTableUpdate())
        commit("SET_ROS_ROBOTURGENCYTASK", _rosUnListener_robotUrgencyTask())
        commit("SET_ROS_ROBOTTASKEXECUTESTATUS", _rosUnListener_robotTaskExecuteStatus())
        commit("SET_ROS_ROBOTTASKCONTROLSTATUS", _rosUnListener_robotTaskControlStatus())
        commit("SET_ROS_ROBOTINSPECTEDRESULTWEB", _rosUnListener_robotInspectedResultWeb())
        commit("SET_ROS_ROBOTSYSALARMWEB", _rosUnListener_robotSysAlarmWeb())
        commit("SET_ROS_ROBOTTASKREALSTATUSWEB", _rosUnListener_robotTaskRealStatusWeb())
        commit("SET_ROS_ROBOTTASKPLANSTATUS", _rosUnListener_robotTaskPlanStatus())
        commit("SET_ROS_ROBOTCONTROLMODE", _rosUnListener_robotControlMode())
        commit("SET_ROS_ROBOTDOGHOUSEANDBACKPOINT", _rosUnListener_robotDogHouseAndBackPoint())
        resolve(rosRobot.state)
      })
    }
  }
}

export default rosRobot